
 const TabBar=[
	 {
	   "role":'delivery', 
	   "list": [
		   {
		   	"pagePath": "pages/index/index",
		   	"text": "首页",
		   	"iconPath": "/static/font/icon/home.png",
		   	"selectedIconPath": "/static/font/icon/home1.png"
		   },
		   {
	  		"pagePath": "pages/distribution/distribution",
	  		"text": "配送",
	  		"iconPath": "/static/font/icon/distribution.png",
	  		"selectedIconPath": "/static/font/icon/distribution1.png"
	  	},
	  	// {
	  	// 	"pagePath": "pages/VerificationSigned/VerificationSigned",
	  	// 	"text": "验签",
	  	// 	"iconPath": "/static/font/icon/yq.png",
	  	// 	"selectedIconPath": "/static/font/icon/yq1.png"
	  	// },
	  	{
	  		"pagePath": "pages/delivered/delivered",
	  		"text": "已配送",
	  		"iconPath": "/static/font/icon/Tbdelivered.png",
	  		"selectedIconPath": "/static/font/icon/Tbdelivered1.png"
	  	},
					{
						"pagePath": "pages/setup/setup",
						"text": "设置",
						"iconPath": "/static/font/icon/yq.png",
						"selectedIconPath": "/static/font/icon/yq1.png"
					}
	  ]
	 },  
	 {
	   "role":'merchants', 
	   "list": [
		 {
		 	"pagePath": "pages/index/index",
		 	"text": "首页",
		 	"iconPath": "static/font/icon/home.png",
		 	"selectedIconPath": "static/font/icon/home1.png"
		 },
		 {
		 	"pagePath": "pages/empower/empower",
		 	"text": "授权",
		 	"iconPath": "static/font/icon/empower.png",
		 	"selectedIconPath": "static/font/icon/empower1.png"
		 },
		 {   
		 	"pagePath": "pages/VerificationSigned/merchantsVs",
		 	"text": "验签",
		 	"iconPath": "static/font/icon/yq.png",
		 	"selectedIconPath": "static/font/icon/yq1.png"
		 	
		 },
		 {
		 	"pagePath": "pages/merchantsSIn/SignedIn",
		 	"text": "已签收",
		 	"iconPath": "static/font/icon/authorized.png",
		 	"selectedIconPath": "static/font/icon/authorized1.png"
		 }
	   ]
	 }	 
 ]
		

export const ReplaceTabBar=function (param){
	for(let  j=0;j<TabBar.length;j++){
		let time=TabBar[j];
		if(param==time.role){
		for(let i=0;i<time.list.length;i++){
			let listMap=time.list[i]
			wx.setTabBarItem({
			  "index": i,
			  "text": listMap.text,
			  "iconPath": listMap.iconPath,
			  "selectedIconPath": listMap.selectedIconPath,
			  "pagePath":listMap.pagePath,  
			  "success":function(res){
                       console.log("成功",res)
               },
               "fail":function(err){
                       console.log("失败",err)
               }
			})
		}
			}
		}
	}
	
	export const ReturnTabBar=function (param){
		
		for(let  j=0;j<TabBar.length;j++){
			let time=TabBar[j];
			if(param==time.role){
				
			return time.list;
				}
			}
		}
	
export default TabBar;
 